package com.jml.spring.IOC.注解方式;

import com.jml.spring.IOC.注解方式.annotation.ExtClassPathXmlApplicationContext;
import com.jml.spring.IOC.注解方式.service.impl.UserServiceImpl;

public class Main {

	public static void main(String[] args) throws Exception {
		//1.根据java反射机制进行扫包，获取当前包下的所有类
		//2.判断类上是否存在注入bean的注解
		//3.使用java的反射机制进行初始化
		ExtClassPathXmlApplicationContext extClassPathXmlApplicationContext = new ExtClassPathXmlApplicationContext(
				"com.jml.spring.IOC.注解方式.service.impl");
		UserServiceImpl userServiceImpl = (UserServiceImpl)extClassPathXmlApplicationContext.getBean("userServiceImpl");
		System.out.println(userServiceImpl);
		userServiceImpl.add();
	}

}
